package com.scnu.recruitment.controller.express;

import com.scnu.common.annotations.NoLogin;
import com.scnu.recruitment.domain.po.ExpOrder;
import com.scnu.recruitment.service.IOrderService;
import com.scnu.recruitment.utils.WechatPay;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/express/order")
@RequiredArgsConstructor
public class OrderController {
    private final IOrderService orderService;
    private final RestTemplate restTemplate = new RestTemplate();
    private final WechatPay wechatPay;


    /**
     * 添加订单，并返回预交易订单号(prepay_id)
     * @param expOrder
     * @return
     */
    @PostMapping("/add")
    public String addOrder(@RequestBody ExpOrder expOrder) {


        return orderService.addOrder(expOrder);

    }

/*    @PostMapping("/pay-success")
    @NoLogin
    public String paySuccess() {


        return null;

    }*/


}

